package itdep.ui.pages.address;

import ga.tapestry.StateConstants;
import ga.tapestry.commonlib.base.pages.EntityPage;
import itdep.domain.address.District;
import itdep.services.address.DistrictService;
import org.apache.tapestry5.ioc.annotations.Inject;

/**
 * @author Ivan Khalopik
 * @version $Revision: 43 $ $Date: 2010-06-25 09:40:26 +0000 (Fri, 25 Jun 2010) $
 */
public class Districts extends EntityPage<District> {

	@Inject
	private DistrictService districtService;

	@Override
	protected DistrictService getEntityService() {
		return districtService;
	}

	public boolean isEditable() {
		final String state = getState();
		return StateConstants.ADD_STATE.equals(state) || StateConstants.EDIT_STATE.equals(state);
	}
}
